<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>具名插槽</title>
</head>
<body>
    <div id="app" style="background-color: red;height: 500px;">
        <h1>我是父组件</h1>
        <child-tag>
            <h2 slot="h2">h2：我是父组件通过插槽传递给子组件的</h2>
            <h3 slot="h3">h3：我是父组件通过插槽传递给子组件的</h3>
        </child-tag>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    const child = {
        template: `
            <div  style="background-color: pink">
                <h1>我是子组件，我有一个插槽，准备给父组件用</h1>
                <slot name="h2"></slot>
                <slot name="h3"></slot>
            </div>
        `
    }
    const app = new Vue({
        el:'#app',
        components:{
            'ChildTag': child
        }
    })

</script>
</html>